import Vue from "vue";
import VueRouter from "vue-router";
import Main from "../views/Main";
import Login from "../views/Login/login.vue";
import home from "../views/home/index.vue"
import User from "../views/User/index.vue"
import mall from "@/views/mall/index.vue";
import pageOne from "@/views/other/pageOne.vue";
import pageTwo from "@/views/other/pageTwo.vue";
import Chat from "../views/Chat/chat.vue";
import Calendar from "../views/calendar.vue";
Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Main",
    component: Main,
    meta: {
      //
      title: '逸悟'
    },
    children: [
      {
        path: "/home",
        name: "home",
        component: home
      },
      {
        path: "/user",
        name: "user",
        component: User,
      },
      {
        path: "/mall",
        name: "mall",
        component: mall,
      },
      {
        path: "/page1",
        name: "page1",
        component: pageOne,
      },
      {
        path: "/page2",
        name: "page2",
        component: pageTwo,
      },

    ],
  },
  {
    path: '/login',
    name: 'login',
    component:Login ,
    meta: {
      //
      title: '逸悟'
    }
  },
  {
    path: "/chat",
    name: "chat",
    component: Chat,
  },
  {
    path: "/calendar",
    name: "calendar",
    component: Calendar,
  },
];

const router = new VueRouter({
  mode: "history",
  routes,
});

export default router;
